<template>
  <div class="header_bgi w_full h_80 lh_80 relative bgs_full">
    <div class="absolute_center">
      <span class="cursor fs_26 fw_bold main_color ls_3" @click="goToHome">{{ headerName }}</span> 
    </div> 

    <!-- <div class="w_500 absolute top_center right_10" v-show="$route.name != 'transaction-table'">
      <el-input class="w_200_i mr_5" v-model="name" placeholder="牧户姓名"></el-input>
      <el-input class="w_200_i mr_5" v-model="rfid" placeholder="rfid"></el-input>
      <el-button type="warning" plain @click="search()">搜索</el-button>
    </div> -->
  </div>
</template>

<script>
  import { Message } from 'element-ui'

  export default {
    name: 'BigScreenHeader',
    props: {
      headerName: ''
    },
    data() {
      return {
        name: null,
        rfid: null,
      }
    },
    async mounted() {
    },
    methods: {
      search() {
        if (!this.name && !this.rfid) {
          Message({
            message: '请输入 牧户 或 rfid',
            type: 'warning',
            duration: 2 * 1000
          })
          return false
        }

        this.$router.push({ path: `/transaction-table/null/null/null/${this.name}/${this.rfid}` })
      },

      // 跳转到 首页
      goToHome() {
        let path = '/'

        this.$router.push({
          path
        })
      },
    }
  }
</script>

